package vo

import (
	"time"
)

type Result struct {
	Success   bool
	Code      int
	Message   string
	Timestamp time.Time `time_format:"yyyy-MM-dd HH:mm:ss"`
	Result    interface{}
}

func OK(data interface{}) Result {
	return Result{Success: true, Code: 200, Message: "操作成功！", Timestamp: time.Now(), Result: data}
}

func Error(message string) Result {
	return Result{Success: false, Code: 500, Message: message, Timestamp: time.Now()}
}
